<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" isELIgnored="false"%>
    
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Merchants info</title>
<style type="text/css">
	 .bar {
	background-color: #2894FF;
	margin-top: 25px;
	width: 100%;
	height: 30px;
	
}


.btn {
        display: inline-block;
        width: 60px;
        border: none 0;
        padding: 4px 0px;
        font-size: 16px;
        font-family: "Microsoft Yahei";
       /*  background-color: rgb(	30,144,2); */
        color: white;
        cursor: pointer;
        text-align: center;
        text-decoration: none; 
        margin-left: 20px;
    }


  a {text-decoration: none; }
  
  #title{color: white; }
  
  #info {
    color: #000000;
}
	#info:hover {
    color: #2894FF;
}
  
  

</style>


</head>
<body>

<div class="bar">
	<table width="90%" height="30%" cellpadding="0" cellspacing="0" style="table-layout:fixed;margin-top: 15px;padding-top: 5px;" align="center" >
	<tr>
		<td width="30" align="center"><a href="showMerchant"  id="title">所有商家信息</a></td>
		<td width="30" align="center"><a href="#" id="title">食品信息</a></td>
		<td width="30" align="center">
			<form action="showSpecificFood" method="post">
				<select name="typeId">
					<c:forEach	var="type" items="${foodTypes }">
						
						<c:if test="${currentType == type.value }">
							<option value=${type.key } selected> ${type.value } </option> 
						</c:if>
						<c:if test="${currentType != type.value}">
							<option value=${type.key }> ${type.value } </option>
						</c:if>
						
					</c:forEach>
					<option value="allType"> 所有 </option> 
				</select>&nbsp;&nbsp;&nbsp;<input type="submit" value="搜索" />
			</form>
		</td>
	</tr>
	</table>
	</div>
	<div>
	
	</div>
	<table style="margin-top: 30px" width="70%" border="1" cellpadding="0" cellspacing="0" style="table-layout:fixed" align="center">
		<tr>
			<td colspan="4" align="center">
				<c:if test="${currentType == 'allType'}">
					<font color="red" size="4" face="arial">${merchant.uname }&nbsp;的所有</font>食品信息
				</c:if>
				<c:if test="${currentType != 'allType'}">
					<font color="red" size="4" face="arial">${merchant.uname }&nbsp;的${currentType}</font>食品信息
				</c:if>
			
			</td>
		
		</tr>
		<tr>
			<td width="45" align="center">序号</td>
			<td width="45" align="center">食品名称</td>
			<td width="45" align="center">食品价格</td>
			<td width="45" align="center">照片</td>
		</tr>
		<c:forEach var="food" items="${foodVOs}" varStatus="status">
			<tr>
			<c:if test="${status.count%2==0}" >
              <tr style="background: #A9A9A9">
           </c:if>
           <c:if test="${status.count%2!=0}" >
              <tr>
           </c:if>
            <td align="center">${status.index +1 }</td>
			<td align="center">${food.name }</td>
			<td align="center">${food.price }</td>
			<td align="center"><img width="100" height="100" alt=${food.img } src=${food.img }></td>
		</tr>
		</c:forEach>
	</table>
</body>
</html>